/**
 * 
 */
package com.kinglian.learn.robot;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource;


/**
 * @author kinglian
 *
 */
public class TestRobotService {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		TaskStatus tsts;
		
//		Resource res = new FileSystemResource("/home/kinglian/mnt/workspace/smartatp/src/application.xml");
//		BeanFactory factory = new XmlBeanFactory(res); 
		
		ApplicationContext ctx = new ClassPathXmlApplicationContext("application.xml");
			
		SmartRobotService rs = (SmartRobotService) ctx.getBean("smartService");
		
		tsts = rs.executeTask();
		
		System.out.println("The task is executed by " + tsts.getLocation()
				+ " ! The result is " + tsts.getResult() + "!");

	}

}
